/*
 * Copyright 2007 National Bioinformatics Network
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package dgbgui.modeldocument.definition;

import java.util.HashSet;
import java.util.Set;

import dgbgui.modeldocument.AttributePrototype;
import dgbgui.modeldocument.primitives.ConceptronType;

public abstract class  FilteredInstanceDefinition extends  Definition implements Cloneable {
    

    public FilteredInstanceDefinition(ConceptronType type) {
        m_conceptronType = type;
    }
    
    public Object clone() {
        FilteredInstanceDefinition clone = (FilteredInstanceDefinition)super.clone();
        clone.m_attribPrototypes = new HashSet<AttributePrototype>();
        for ( AttributePrototype a : m_attribPrototypes ) {
            clone.m_attribPrototypes.add((AttributePrototype)a.clone());
        }
        return clone;
    }
    
    
    /**
     * @return the m_attribPrototypes
     */
    public Set<AttributePrototype> getAttribProtoTypes() {
        return m_attribPrototypes;
    }

    /**
     * @param protoTypes
     *            the m_attribPrototypes to set
     */
    public void setAttribProtoTypes(Set<AttributePrototype> protoTypes) {
        m_attribPrototypes = protoTypes;
    }
    
    public ConceptronType getConceptronType() {
        return m_conceptronType;
    }
    
    public String getTypeName() {
        return m_conceptronType.m_name;
    }
    
    // ------------------- Serialization -------------
    
    /**
     * First serilization version
     */
    private static final long serialVersionUID = 1L;
    

    // ------------------- Fields ---------------------
    
    // The attribute prototypes for the concept prototype
    protected Set<AttributePrototype> m_attribPrototypes = new HashSet<AttributePrototype>();
    
    ConceptronType m_conceptronType;
}
